package com.ymatou.iapi.productprice.service;

import java.util.List;

import com.google.common.reflect.TypeToken;
import com.ymatou.iapi.productprice.parameter.ProductBriefPrice;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*获取商品价格简要列表
*FreeMaker Template自动生成代码
*/
public class GetBriefPriceByProdIdsCall extends YmatouBaseCall{
	private static String opurl ="api/Price/GetBriefPriceByProdIds";
	
	public GetBriefPriceByProdIdsCall() {
		super(EnvSetup.getSystemUrl("productprice"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public List<ProductBriefPrice> getProductPriceList(){
		String sProductPriceList=getJsonObject().get("Data").getAsJsonObject().get("ProductPriceList").getAsJsonArray().toString();
		List<ProductBriefPrice> ProductPriceList=(List<ProductBriefPrice>)FormatUtil.GSONToObject(sProductPriceList, new TypeToken<List<ProductBriefPrice>>(){}.getType());
		return ProductPriceList;
	}
}